class PSThrowableObjectContainer extends PSThrowableObject
	placeable;

var Rotator NewRotation;

function Tick (float Delta)
{
	local Vector DestinationLocation;
	local Rotator DestinationRotation;
	
	
	super.Tick(Delta);

	if(Carrier != none)
	{
		//Carrier.GetActorEyesViewPoint(PawnLocation, PawnRotation);
		DestinationLocation = Carrier.Location;
		DestinationLocation.Z += 30;
		DestinationRotation = Carrier.Controller.Rotation;

		DestinationRotation.Pitch = 0;

		if(Rotation == DestinationRotation)
		{
			bJustGrabbed = false;
		}

		if(bJustGrabbed)
		{
			SetLocation(VInterpTo(Location, DestinationLocation + Vector(DestinationRotation)*120, Delta, 10));			
		}
		else
		{
			SetLocation(VInterpTo(Location, DestinationLocation + Vector(DestinationRotation)*100, Delta, 10));

			/*if(Rotation != NewRotation)
			{
				SetRotation(RInterpTo(Rotation, NewRotation, Delta, 1, false));
			}
			else
			{
				NewRotation.Pitch = Rand(360) * DegToUnrRot;
				NewRotation.Yaw = Rand(360) * DegToUnrRot;
				NewRotation.Roll = Rand(360) * DegToUnrRot;
			}*/
		}
	
		//SetLocation(VInterpTo(Location, PawnLocation + Vector(PawnRotation)*100, Delta, 5));
		SetRotation(RInterpTo(Rotation, DestinationRotation, Delta, 5));
		
	}
}    

function RigidBodyCollision( PrimitiveComponent HitComponent, PrimitiveComponent OtherComponent,
				const out CollisionImpactData RigidCollisionData, int ContactIndex )
{
	local float linVel;
	linVel = ABS(Sqrt(RigidCollisionData.ContactInfos[ContactIndex].ContactVelocity[0].X**2 + RigidCollisionData.ContactInfos[ContactIndex].ContactVelocity[0].Y**2 + RigidCollisionData.ContactInfos[ContactIndex].ContactVelocity[0].Z**2));

	if( linVel>50.0) 
	{
		PlaySound(SoundCue'PS_sounds.Metal.SC_hit_metal',,,,Location);
	}
}

DefaultProperties
{	
	Begin Object Name=StaticMeshComponent0
		StaticMesh=StaticMesh'PS_ST_box_metal_big.Mesh.ST_box_metal_big'
		BlockActors=true
		CollideActors=true
		BlockZeroExtent=true
		BlockNonZeroExtent=true
		AlwaysCheckCollision=true
		HiddenGame=FALSE 
		HiddenEditor=FALSE
		//LightEnvironment=MyLightEnvironment	
		bNotifyRigidBodyCollision=true
		ScriptRigidBodyCollisionThreshold=1
    End Object
	Mesh=StaticMeshComponent0
	CollisionComponent=StaticMeshComponent0
	Components.Add(StaticMeshComponent0)

	/*Begin Object Class=CylinderComponent Name=CollisionCylinder
		bDrawBoundingBox=true
        CollisionRadius=30.00
        CollisionHeight=10.00
        CollideActors=true
        BlockActors=true
    End Object
	//CollisionComponent=CollisionCylinder
	//CylinderComponent=CollisionCylinder
	Components.Add(CollisionCylinder)*/

	// This makes the KActor collide with blocking volumes (BSPs don't collide, so this is a workaround)
	bCollideWorld=true		

	ThrowingMomentum=2500.0
	HitDamage=50;
}
